package vip.guzb.demo;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * 一个简易的Web控制器样例
 *
 * @author 顾志兵
 * @mail ipiger@163.com
 * @since 2024-03-26
 */
@RestController
@RequestMapping("/")
public class SampleController {

    @GetMapping("/test")
    public String justRequest() throws InterruptedException {
        System.out.println("[SampleController#justRequest]: 将于10秒后返回");
        TimeUnit.SECONDS.sleep(10);
        System.out.println("[SampleController#justRequest]: 10秒时间到了，返回给客户端");
        return "我是10秒后才回返给你的";
    }

}
